<?php 
class session implements arrayaccess {
	
	public function __construct()
	{
		session_name('CMS_Session');
		@session_start();
	}
	
	public function set($var, $value)
	{
		$_SESSION[$var] = $value;
	}
	
	public function get($var)
	{
		if (isset($_SESSION[$var]))
		{
			return $_SESSION[$var];
		}
		else
		{
			return false;
		}
	}
	
	public function delete($var)
	{
		unset($_SESSION[$var]);
	}
	
	public function destroy()
	{
		$_SESSION = array();
	}
	
	public function offsetExists($key)
	{
		return $this->get($key) !== false;
	}
	
	public function offsetGet($key)
	{
		return $this->get($key);
	}
	
	public function offsetSet($key, $value)
	{
		$this->set($key, $value);
	}
	
	public function offsetUnset($key)
	{
		$this->delete($key);
	}
}
?>